﻿<%@ Page Title="Marketing - Input Activity" Language="C#" MasterPageFile="marketing.master"
    AutoEventWireup="true" CodeFile="InputActivity.aspx.cs" Inherits="NPS_app_Marketing_InputActivity" %>

<%@ Register Assembly="eWorld.UI, Version=2.0.1.2222, Culture=neutral, PublicKeyToken=24d65337282035f2"
    Namespace="eWorld.UI" TagPrefix="ew" %>
<asp:Content ContentPlaceHolderID="Back" runat="server">
    <a class="backbutton" href="../../Default.aspx" data-bind="click: closeApp">
        <img src="../../img/Left.png" />
    </a>
</asp:Content>
<asp:Content ContentPlaceHolderID="Header" runat="server">
    Marketing: Input New Activity
</asp:Content>
<asp:Content ContentPlaceHolderID="body" runat="server">
    <div id="body">
        <!-- Jquery Core-->
        <script type="text/javascript" src="../../js/jquery182.js"></script>
        <script type="text/javascript" src="../../js/jquery-ui.js"></script>
        <link rel="stylesheet" href="../../css/jquery-ui.css">
        <script type="text/javascript" src="../../js/jquery.jgrowl.js"></script>
        <link rel="stylesheet" href="../../css/jquery.jgrowl.css">
        <div class="container metro">
            <form class="metro-form" runat="server" id="Marketing">
            <style>
                .alpha60
                {
                    /* Fallback for web browsers that doesn't support RGBa */
                    background: rgb(0, 0, 0) transparent; /* RGBa with 0.6 opacity */
                    background: rgba(0, 0, 0, 0.6); /* For IE 5.5 - 7*/
                    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000); /* For IE 8*/
                    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
                }
                .lmit {
                position:relative;top:5px;}
            </style>
            <script>


                function CloseDialog() {
                    $("#divPopup").slideToggle();
                    $("#divPopupOverlay").slideToggle();
                }
                $(document).ready(function () {
                    $("#divPopup").hide();
                    $("#divPopupOverlay").hide();

                    $('#<%= BtnAdd.ClientID %>').live('click', function () {
                        $("#divPopup").slideToggle();
                        $("#divPopupOverlay").slideToggle();
                    });
                    $('#closePopup').live('click', function () {
                        $("#divPopup").slideToggle();
                        $("#divPopupOverlay").slideToggle();
                    });
                    $('#divPopupOverlay').live('click', function () {
                        $("#divPopup").slideToggle();
                        $("#divPopupOverlay").slideToggle();
                    });
                });

                function validateInput() {
                    var returner = true;

                    var x = $('#<%= txtNama.ClientID %>').val();
                    if (x == "" || x == null) {
                        returner = false;
                        $.jGrowl("Judul belum diisi", { position: 'bottom-left' });
                    }
                    var y = $('#<%= txtTempat.ClientID %>').val();
                    if (y == "" || y == null) {
                        returner = false;
                        $.jGrowl("Tempat belum diisi", { position: 'bottom-left' });
                    }
                    var y = $('#<%= txtDetail.ClientID %>').val();
                    if (y == "" || y == null) {
                        returner = false;
                        $.jGrowl("Detail belum diisi", { position: 'bottom-left' });
                    }
                    var z = $('#<%= ddlMarketingType.ClientID %>').selectedIndex;
                    if (z == 0) {
                        returner = false;
                        $.jGrowl("Silahkan pilih marketing type", { position: 'bottom-left' });
                    }
                    if (returner) {
                        return confirm("Apakah anda yakin untuk menyimpan Aktivitas ini?");
                    } else return returner;
                }

               
            </script>
            <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"
                AsyncPostBackTimeout="7200" ScriptMode="Auto">
            </asp:ScriptManager>
            <asp:UpdatePanel ID="upHeader" runat="server" UpdateMode="Conditional">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="gvSearch" EventName="RowCommand" />
                    <asp:PostBackTrigger ControlID="gvAttendant" />
                </Triggers>
                <ContentTemplate>
                    <div style="width: 1200px;">
                        <div style="float: left; width: 350px;">
                            <div class="metro-form-control" style="width: 300px">
                                <label>
                                    Judul</label>
                                <div class="metro-text-box">
                                    <asp:TextBox ID="txtNama" runat="server"></asp:TextBox>
                                </div>
                            </div>
                            <div class="metro-form-control" style="width: 320px">
                                <label>
                                    Jenis Aktivitas</label>
                                <div class="metro-text-box">
                                    <asp:DropDownList ID="ddlMarketingType" Width="320px" runat="server" DataTextField="sxTitle"
                                        AutoPostBack="true" DataValueField="iID" OnSelectedIndexChanged="ddlMarketingType_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="metro-form-control" style="width: 320px">
                                <label>
                                    Nama Aktivitas</label>
                                <div class="metro-text-box">
                                    <asp:DropDownList ID="ddlMarketingName" Width="320px" runat="server" DataTextField="sxTitle"
                                        Enabled="false" AutoPostBack="true" DataValueField="iID" OnSelectedIndexChanged="ddlMarketingName_SelectedIndexChanged">
                                    </asp:DropDownList>
                                    <asp:HiddenField runat="server" ID="hfLimit" />
                                </div>
                            </div>
                            <div class="metro-form-control" style="width: 300px">
                                <label>
                                    Detail</label>
                                <div class="metro-text-box">
                                    <asp:TextBox ID="txtDetail" runat="server" TextMode="MultiLine" Style="max-height: 100px;
                                        min-height: 100px; max-width: 300px; min-width: 300px;"></asp:TextBox>
                                </div>
                            </div>
                            <div class="metro-form-control" style="width: 300px">
                                <label>
                                    Tempat</label>
                                <div class="metro-text-box">
                                    <asp:TextBox ID="txtTempat" runat="server"></asp:TextBox>
                                </div>
                            </div>
                            <div class="metro-form-control" style="width: 300px">
                                <label>
                                    Tanggal Mulai</label>
                                <div class="metro-text-box">
                                    <ew:CalendarPopup ID="txtTglMulai" runat="server" Culture="Indonesian (Indonesia)" DisableTextBoxEntry="False"
                                        DisplayPrevNextYearSelection="True" Font-Size="X-Small" PadSingleDigits="True"
                                        PopupLocation="Right" ShowGoToToday="True" UpperBoundDate="9999-12-31" Width="80px">
                                        <ButtonStyle Font-Size="0" CssClass="metro-button-srch" Height="30px" />
                                        <TextBoxLabelStyle Height="16px" />
                                    </ew:CalendarPopup>
                                </div>
                            </div>
                            <div class="metro-form-control" style="width: 300px">
                                <label>
                                    Tanggal Akhir</label>
                                <div class="metro-text-box">
                                    <ew:CalendarPopup ID="txtTglAkhir" runat="server" Culture="Indonesian (Indonesia)" DisableTextBoxEntry="False"
                                        DisplayPrevNextYearSelection="True" Font-Size="X-Small" PadSingleDigits="True"
                                        PopupLocation="Right" ShowGoToToday="True" UpperBoundDate="9999-12-31" Width="80px">
                                        <ButtonStyle Font-Size="0" CssClass="metro-button-srch" Height="30px" />
                                        <TextBoxLabelStyle Height="16px" />
                                    </ew:CalendarPopup>
                                </div>
                            </div>
                            <asp:Button ID="btnSave" OnClick="btnSave_Click" runat="server" CssClass="metro-button"
                                Text="Simpan" OnClientClick="return validateInput()" />
                            &nbsp;
                            <asp:Button ID="btnCancel" OnClick="btnCancel_Click" runat="server" CssClass="metro-button"
                                Text="Batal" />
                        </div>
                        <div style="float: left;">
                            <div>
                                <button runat="server" id="BtnAdd" class="metro-button">
                                    Tambah Peserta</button>
                                 <asp:Label runat="server" Text="max 50 attendant" ID="lblLimit" CssClass="lmit" />
                            </div>
                            <asp:GridView ID="gvAttendant" runat="server" AutoGenerateColumns="false" Font-Names="Arial"
                                Font-Size="11pt" HeaderStyle-BackColor="#626270" BorderColor="white" BorderStyle="Solid"
                                RowStyle-BackColor="#6291B1" AlternatingRowStyle-BackColor="#4FA1DA" BorderWidth="4px"
                                AllowPaging="true" OnPageIndexChanging="OnPaging" PageSize="15" OnRowCommand="gvAttendant_RowCommand">
                                <Columns>
                                    <asp:BoundField ItemStyle-Width="30px" ItemStyle-HorizontalAlign="Center" DataField="iID"
                                        HeaderText="No" Visible="false" />
                                    <asp:TemplateField>
                                    <HeaderTemplate>
                                    No.
                                    </HeaderTemplate>
                                        <ItemTemplate>
                                            <%# Container.DataItemIndex + 1 %>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField ItemStyle-Width="250px" DataField="sxPICName" HeaderText="Nama" />
                                    <asp:BoundField HeaderText="Perusahaan" DataField="sxcompanyname" ItemStyle-Font-Size="11px" />
                                    <asp:BoundField HeaderText="Jabatan" DataField="sxposition" ItemStyle-Font-Size="11px" />
                                    <asp:BoundField ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center" DataField="sxGender"
                                        HeaderText="Gender" />
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:LinkButton runat="server" ID="btndel" ToolTip="Hapus user" CommandName="deletes"
                                                CommandArgument="<%# ((GridViewRow) Container).RowIndex %>">
                                        <img src="../../../images/close.png" />
                                            </asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </div>
                    </div>
                </ContentTemplate>
            </asp:UpdatePanel>
            <div id="divPopupOverlay" class="alpha60" style="width: 3000px; height: auto; position: fixed;
                top: 0; bottom: 0; right: 0;">
            </div>
            <div id="divPopup" style="position: absolute; z-index: 99; top: 100px; left: 200px;
                background-color: #2597CB; padding: 20px;">
                <asp:UpdatePanel runat="server" ID="up1" >
                <Triggers><asp:AsyncPostBackTrigger ControlID="gvSearch" EventName="PageIndexChanging" />
                </Triggers>
                    <ContentTemplate>
                        <div>
                            <table>
                                <tr>
                                    <td style="width: 90px;">
                                        <label>
                                            Nama</label>
                                    </td>
                                    <td>
                                        <div class="metro-text-box">
                                            <asp:TextBox ID="txtSearchName" runat="server"></asp:TextBox>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <label>
                                            Perusahaan</label>
                                    </td>
                                    <td>
                                        <div style="height: 38px;">
                                            <div class="metro-text-box">
                                                <asp:TextBox ID="txtSearchCompany" runat="server"></asp:TextBox>
                                            </div>
                                            <div style="position: relative; top: -52px; right: -239px;">
                                                <asp:LinkButton runat="server" CssClass="metro-button" ID="btnSearch" Text="Cari"
                                                    OnClick="btnSearch_Click" /></div>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <div class="metro-form" style="width: 800px; font-size: 14px;">
                                            <asp:GridView ID="gvSearch" runat="server" Width="100%" Height="1px" AllowPaging="True"
                                                HeaderStyle-BackColor="#626270" Font-Names="Arial" Font-Size="11pt" RowStyle-VerticalAlign="Top"
                                                AutoGenerateColumns="False" PageSize="10" BorderColor="white" BorderStyle="Solid" 
                                                RowStyle-BackColor="#6291B1" AlternatingRowStyle-BackColor="#4FA1DA" BorderWidth="4px"
                                                CellPadding="3" ForeColor="Black" GridLines="Both" Style="margin-top: 0em;" ShowFooter="false"
                                                OnRowCommand="gvSearch_RowCommand" OnPageIndexChanging="gvSearch_PageIndexChanging">
                                                <Columns>
                                                    <asp:BoundField HeaderText="Nama" DataField="sxpicname" ItemStyle-Font-Size="11px" />
                                                    <asp:BoundField HeaderText="Perusahaan" DataField="sxcompanyname" ItemStyle-Font-Size="11px" />
                                                    <asp:BoundField HeaderText="Jabatan" DataField="sxposition" ItemStyle-Font-Size="11px" />
                                                    <asp:TemplateField ItemStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="Center"
                                                        ItemStyle-Width="100px">
                                                        <ItemTemplate>
                                                            <asp:LinkButton Text="Pilih" runat="server" ID="btnChoose" CssClass="metro-button"
                                                                Style="font-size: 11px; margin: 0; padding: 0 10px 0 10px;" CommandName="choose"
                                                                CommandArgument='<%# Eval("iID") %>' />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <EmptyDataTemplate>
                                                    No Records Found</EmptyDataTemplate>
                                                <PagerSettings PageButtonCount="5" NextPageText="Next" PreviousPageText="Previous"
                                                    FirstPageText="First" LastPageText="last" Mode="NumericFirstLast" />
                                            </asp:GridView>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <div style="position: absolute; top: 9px; right: 11px;">
                                <button class="metro-button" id="closePopup">
                                    Close</button>
                            </div>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
            <asp:UpdateProgress ID="updateProgress" runat="server">
                <ProgressTemplate>
                    <div style="position: fixed; text-align: center; height: 100%; width: 100%; top: 0;
                        right: 0; left: 0; z-index: 9999999; background-color: #000000; opacity: 0.7;">
                        <span style="border-width: 0px; position: fixed; padding: 50px; background-color: #FFFFFF;
                            font-size: 36px; left: 40%; top: 40%; color: Black;">Please Wait...</span>
                    </div>
                </ProgressTemplate>
            </asp:UpdateProgress>
            </form>
        </div>
    </div>
</asp:Content>
